package com.mydomain.Bodega;

import com.mydomain.Bodega.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("invDevolucionHome")
public class InvDevolucionHome extends EntityHome<InvDevolucion> {

	@In(create = true)
	SubdepartamentoHome subdepartamentoHome;

	public void setInvDevolucionDevCodigo(Long id) {
		setId(id);
	}

	public Long getInvDevolucionDevCodigo() {
		return (Long) getId();
	}

	@Override
	protected InvDevolucion createInstance() {
		InvDevolucion invDevolucion = new InvDevolucion();
		return invDevolucion;
	}

	public void wire() {
		getInstance();
		Subdepartamento subdepartamento = subdepartamentoHome
				.getDefinedInstance();
		if (subdepartamento != null) {
			getInstance().setSubdepartamento(subdepartamento);
		}
	}

	public boolean isWired() {
		return true;
	}

	public InvDevolucion getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<InvDevolucionIte> getInvDevolucionItes() {
		return getInstance() == null ? null : new ArrayList<InvDevolucionIte>(
				getInstance().getInvDevolucionItes());
	}

}
